package system.controller;

import common.controller.base.BaseController;
import common.model.request.SendEmailRequest;
import common.model.response.base.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import system.service.MailService;

import javax.annotation.Resource;

/**
 * 邮件管理
 *
 * @author 米泽鹏
 * @since 2023-11-06
 */
@Api(tags = "邮件管理")
@RestController
@RequestMapping("/system/mail")
public class MailController extends BaseController {

	@Resource
	private MailService mailService;

	@ApiOperation(value = "sendEmail", notes = "发邮件")
	@PostMapping("/sendEmail")
	public Result<?> sendEmail(@ApiParam(value = "发邮件请求", required = true) @RequestBody @Validated SendEmailRequest request) {
		return mailService.sendEmail(request);
	}

}
